package com.android.sdcard.folder;

import java.util.Locale;

public class FolderComponent implements Comparable<FolderComponent> {
	
	public enum Type {
		FILE, FOLDER, UP
	}
	
	private String name;
	private String data;
	private String date;
	private String path;
	private Type type;

	public FolderComponent(String name, String data, String date, String path,
			Type type) {
		this.name = name;
		this.data = data;
		this.date = date;
		this.path = path;
		this.type = type;

	}

	public String getName() {
		return name;
	}

	public String getData() {
		return data;
	}

	public String getDate() {
		return date;
	}

	public String getPath() {
		return path;
	}

	public Type getType() {
		return type;
	}

	public int compareTo(FolderComponent o) throws IllegalArgumentException {
		if (this.name != null)
			return this.name.toLowerCase(Locale.getDefault()).compareTo(o.getName().toLowerCase(Locale.getDefault()));
		else
			throw new IllegalArgumentException("Component name cannot be null");
	}
	
}
